package demo.demo01;

public class PersonA {
    String name;
    int age;
    public PersonA(String name, int age) {
        this.name = name;
        this.age = age;
    }
    public PersonA(){
        this.name = "John";
        this.age = 20;
    }
    void display(){
        System.out.println("Name: " + name);
        System.out.println("Age: " + age);
    }
}
class StudentA extends PersonA{
    int classno;
    public StudentA(String name, int age, int classno){
        super(name, age);
        this.classno = classno;
    }
    public StudentA(){
        this.name = "mary";
        this.age = 18;
        this.classno = 1;
    }
    void display(){
        super.display();
        System.out.println("Classno: " + classno);
    }
}
class Main{
    public static void main(String[] args) {
        PersonA person = new PersonA();
        person.display();
        StudentA student = new StudentA();
        student.display();
    }
}
